#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<assert.h>
#include<stdlib.h>
using namespace std;
class seqlist
{
public:
	void pushback(int x)
	{
		a[size++] = x;
	}
	int size() const
	{
		return size;
	}

	const int& operator[](int i) const
	{
		assert(i < size);
		return a[i];
	}

	int& operator[](int i)
	{
		assert(i < size);
		return a[i];
	}


private:
	int* a = (int*)malloc(sizeof(int) * 10);
	int size = 0;
	int capacity = 0;
};

void seqlist::print(const seqlist& s1)
{
	for (size_t i = 0; i < s1.size(); i++)
	{
		s1[i]++;
		cout << s1[i] << " ";
	}
	cout << endl;
}
int main()
{
	seqlist s;
	s.pushback(1);
	s.pushback(2);
	s.pushback(3);
	s.pushback(4);

	print(s);

	for (size_t i = 0; i < s.size(); i++)
	{
		cout << s[i] << "";
	}

	for (size_t i = 0; i < s.size(); i++)
	{
		s[i]++;
	}

	for (size_t i = 0; i < s.size(); i++)
	{
		cout << s[i] << "";
	}
	cout << endl;
	return 0;
}